package UIFree.controls
{
	import UIFree.uif_component;
	import UIFree.uif_ecomponent;
	
	import flash.geom.Rectangle;
	
	public class uif_inputLayer extends uif_ecomponent {
		private var _label: uif_label;
		private var _input: uif_input;
		public function uif_inputLayer(parent:uif_component, ax:int, ay:int, 
									   awidth:int, aheight:int,
									   a_labelWidth: int, caption: String, value: String='',
									   styleClass:Object='') {
			super(parent, ax, ay, awidth, aheight, styleClass);
			var inner: Rectangle = getInner();
			var space: Number = getSpace(true);
			_label = new uif_label(this, inner.x, inner.y, a_labelWidth, inner.height, style.label);
			inner.left += _label.width + space;
			_input = new uif_input(this, inner.x, inner.y, inner.width, inner.height, style.input);
			if (value) _input.text = value;
			_label.text = caption;
		}
		
		public function get label(): uif_label {
			return _label;
		}
		
		public function get input(): uif_label {
			return _input;
		}
		
		public function get value(): String {
			return _input.text;
		}

		public function set value(a_value: String): void {
			_input.text = a_value;
		}
	}
}